package com.jonsion.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.jonsion.dao.SqlMapper;
import com.jonsion.domain.Site;

public interface SiteMapper extends SqlMapper {
	/** 
	* 添加 
	* 
	* @param account 
	*            实体 
	* @throws Exception 
	*             抛出异常 
	*/ 
	
	@Insert("insert into Site values(SITE_SQEUENCE.NEXTVAL,#{site_url},#{site_name})")
	public void add(Site account) throws Exception; 

	
	/** 
	* 查询 
	* 
	* @param entity 
	*            封装数据的实体 
	* @return 返回查询结果 
	* @throws Exception 
	*             抛出所有异常 
	*/ 
	@Select("select * from Site t where t.site_url=#{site_url}")
	public List<Site> getSiteByUserName(Site account) throws Exception;
	
	
	/** 
	* 查询 
	* 
	* @param entity 
	*            封装数据的实体 
	* @return 返回查询结果 
	* @throws Exception 
	*             抛出所有异常 
	*/ 
	@Select("select * from  Site ") 
	public List<Site> list() throws Exception;

}
